package com.lagou;

import com.alibaba.fastjson.JSON;

/**
 * @ Author     ：JYO
 * @ Date       ：Created in 17:02 2020-04-21
 * @ Description：
 * @ Modified By：
 * @Version: $
 */

public class JSONSerializer implements Serializer{




    public byte[] serialize(Object object) {

        return JSON.toJSONBytes(object);

    }




    public <T> T deserialize(Class<T> clazz, byte[] bytes) {

        return JSON.parseObject(bytes, clazz);

    }

}